<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:dc="clr-namespace:DentalConfig;assembly=DentalConfig"
  xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
  xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf">
  <!-- Resource dictionary entries should be defined here. -->

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="../Brushes/MaterialDesign/MaterialDesignTheme.Theme.xaml"/>
    <ResourceDictionary Source="../Brushes/Common.xaml"/>
  </ResourceDictionary.MergedDictionaries>
  <converters:BrushRoundConverter x:Key="BrushRoundConverter"/>
  <converters:EqualityToVisibilityConverter x:Key="EqualityToVisibilityConverter" />

  <!-- This style is used in the MultiMessageBoxWithOptionsWindow<T> -->

  <!--PlainView Default Style for ListView-->
  <Style x:Key="PlainView" TargetType="{x:Type ListView}">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="Width" Value="Auto"/>
    <Setter Property="Height" Value="Auto"/>
    <Setter Property="MaxHeight" Value="250"/>
    <Setter Property="Margin" Value="0"/>
    <Setter Property="FontSize" Value="11"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="ItemContainerStyle">
      <Setter.Value>
        <Style x:Key="{x:Type ListViewItem}" TargetType="ListViewItem">
          <Setter Property="SnapsToDevicePixels" Value="true"/>
          <Setter Property="OverridesDefaultStyle" Value="true"/>
          <Setter Property="Height" Value="Auto"/>
          <Setter Property="Foreground" Value="{StaticResource MaterialDesignBody}"/>
          <Setter Property="Background" Value="Transparent"/>
          <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignDivider}"/>
          <Setter Property="BorderThickness" Value="0,0,0,1"/>
          <Setter Property="FontFamily" Value="{DynamicResource ContentFontFamily}"/>
          <Setter Property="FontSize" Value="11"/>
          <Setter Property="VerticalContentAlignment" Value="Center"/>
          <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="ListViewItem">
                <Border Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Margin="{TemplateBinding Margin}"
                        ClipToBounds="{TemplateBinding ClipToBounds}">
                  <Grid>
                    <Border x:Name="SelectedBackgroundBorder"
                            Opacity="0"
                            Background="{TemplateBinding Background}" />
                    <wpf:Ripple x:Name="Ripple" Feedback="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}"
                                Opacity="1"
                                Focusable="False"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                Padding="{TemplateBinding Padding}">
                    </wpf:Ripple>
                  </Grid>
                </Border>
                <ControlTemplate.Triggers>
                  <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{DynamicResource MaterialDesignSelection}" />
                  </Trigger>
                  <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background">
                      <Setter.Value>
                        <SolidColorBrush Color="{DynamicResource MaterialDesignColorSelection}" Opacity="0.4"/>
                      </Setter.Value>
                    </Setter>
                  </Trigger>
                  <MultiTrigger>
                    <MultiTrigger.Conditions>
                      <Condition Property="IsSelected" Value="True" />
                      <Condition Property="IsMouseOver" Value="True" />
                    </MultiTrigger.Conditions>
                      <Setter Property="Background">
                        <Setter.Value>
                          <SolidColorBrush Color="{DynamicResource MaterialDesignColorSelection}" Opacity="0.72"/>
                        </Setter.Value>
                      </Setter>
                  </MultiTrigger>
                  <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Opacity" Value="{StaticResource DisabledOpacity}"/>
                  </Trigger>
                </ControlTemplate.Triggers>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListView">
          <Border Name="Border" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{StaticResource MaterialDesignTextBoxBorder}" Background="{StaticResource MaterialDesignPaper}" CornerRadius="0">
            <ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
              <ItemsPresenter/>
            </ScrollViewer>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsGrouping" Value="true">
              <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Opacity" Value="{DynamicResource DisabledOpacity}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!--PlainView Default Style for ListView to present the items only i.e., without interaction and selection capabilities-->
  <Style x:Key="OnlyPresentationItemContainerStyle" TargetType="ListViewItem">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="Height" Value="Auto"/>
    <Setter Property="Foreground" Value="{StaticResource MaterialDesignBody}"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignDivider}"/>
    <Setter Property="BorderThickness" Value="0,0,0,1"/>
    <Setter Property="FontWeight" Value="Normal"/>
    <Setter Property="FontSize" Value="11"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListViewItem">
          <Border Name="OuterBorder" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <Border Name="InnerBorder" Background="{StaticResource ButtonInnerBackground}" Padding="2">
              <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" OpacityMask="{x:Null}" Margin="0,0,0,0"/>
            </Border>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>
